package com.molichuxing.services.property;

/**
 * 是否回购(0:否，1：是)
 * @author xuelin yi
 */
public enum GoodsBuyBackEnum {

  NO((byte)0, "不回购"),YES((byte)1, "回购");

  byte value;
  String name;

  GoodsBuyBackEnum(byte value, String name) {
    this.value = value;
    this.name = name;
  }

  public byte getValue() {
    return value;
  }

  public String getName() {
    return name;
  }

  /**
   * 通过value获取枚举的name
   * @param value
   * @return
   */
  public static GoodsBuyBackEnum getName(byte value) {
    for (GoodsBuyBackEnum orderSource : GoodsBuyBackEnum.values()) {
      if (orderSource.getValue() == value) {
        return orderSource;
      }
    }
    return null;
  }
}
